package oop2;

/**
 * @author oldliu
 * @since 1.0
 */
public class Calculator {
    public int divide(int a,int b)throws Exception{
        if(b==0){
            throw new Exception("除数不能是0");
        }
        return  a/b;
//        try {
//            return a / b;
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return 0;
    }
    public int div(int a,int b)throws ArithmeticException{
        return a/b;
    }
}
